package com.yingxin.yxerp.module.permission.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yingxin.yx.framework.user.dto.PermissionDto;
import com.yingxin.yxerp.module.permission.entity.Permission;
import com.yingxin.yxerp.module.permission.vo.req.PermissionQueryVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 权限表 Mapper 接口
 * @author fanchao
 * @since 2021-05-10
 */

public interface PermissionMapper extends BaseMapper<Permission> {

    List<PermissionDto> listDto();

    List<PermissionDto> listDtoByRoleId(@Param("roleId") String roleId);

    void saveTempPermissions(@Param("permissions") List<Permission> permissions);

    /**
     * 根据user_id 和 权限标识 获取是否存在次权限
     */
    List<String> listPermissionByUserIdAndPermissionString( @Param("queryObj") PermissionQueryVo queryObj);

}
